<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<%@include file="/WEB-INF/common/taglibs.jsp"%>    
    <title>江苏龙芯梦兰科技股份有限公司-SMT生产管理系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="${ctx}resources/js/page.js"></script>
	<link rel="stylesheet" type="text/css" href="${ctx}resources/css/common.css" />
  </head>
  <script type="text/javascript">
 
  	function add(){
  		var ps = $("#produce").val();
  		for(i=0;i<ps.length;i++){
  			var text = $("#produce option[value='"+ps[i]+"']").text();
  			$("#pack").append("<option ondblclick='remove()' value='"+ps[i]+"'>"+text+"</option>"); 
  			$("#produce option[value='"+ps[i]+"']").remove();
  		}
  	}
  	function remove(){
  		var ps = $("#pack").val();
  		for(i=0;i<ps.length;i++){
  			var text = $("#pack option[value='"+ps[i]+"']").text();
  			$("#produce").append("<option ondblclick='add()' value='"+ps[i]+"'>"+text+"</option>"); 
  			$("#pack option[value='"+ps[i]+"']").remove();
  		}
  	}
  	function savePack(){
  		var packNo = $("#packNo").val();
  		if(packNo==""){
  			alert("请输入箱号！ ");
  			$("#packNo").focus();
  			return;
  		}
  		var max = parseInt("${maxPage}");
  		var items = $("#pack option[value!='']");
  		var packNum = items.length;
  		if(packNum>max){
  			alert("每箱最多能包"+max+"块板子");
  			return;
  		}
  		if(packNum<=0){
  			alert("每箱至少包装1块板子");
  			return;
  		}
  		for(i=0;i<items.length;i++){
  			items[i].selected = true;
  		}
  		$("#packFrom").submit();
  	}
  </script>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
						<td width="6%" height="19" valign="bottom"><div align="center"><img src="${ctx}resources/images/tb.gif" width="14" height="14" /></div></td>
						<td width="94%" valign="bottom"><span class="STYLE1"> 包装信息</span></td>
				  </tr>
				</table>
            </td>
            <td>
			<div align="right">
				<span class="STYLE1"> <a href="${ctx}pack/addpack.htm?orderid=${orderid}" style="color: #e1e2e3;text-decoration: none">添加</a>&nbsp;&nbsp;</span>
			</div>
			</td>
          </tr>
        </table>
		</td>
      </tr>
    </table>
    </td>
  </tr>
  <form id="mainForm" action="${ctx}pack/list.htm" method="post">
				<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}" />
				<input type="hidden" name="page.orderBy" id="orderBy" value="id" />
				<input type="hidden" name="page.order" id="order" value="asc" />
				<input type="hidden" name="orid" id="order" value="${orderid}" />
  <tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
				<tr style="padding-top: 2px">
								<td class="STYLE19" bgcolor="#FFFFFF" colspan="16">
									<span style="padding-left: 40px;">箱号:<input type="text" name="filter_LIKES_boxNo" value="${param['filter_LIKES_boxNo']}" style="width: 80px"> </span>
									<span style="padding-left: 20px"><input type="button" name="" onclick="search();" value="查询"> </span>
								</td>
							</tr>
				<tr bgcolor="d3eaef">
					<td width="10%" height="20" align="center">箱号</td>
					<td width="14%" height="20" align="center">订单号</td>
					<td width="16%" height="20" align="center">时间</td>
					<td width="27%" height="20" align="center">用户名</td>
					<td width="14%" height="20" align="center">数量</td>
					<td width="14%" height="20" align="center">基本操作</td>
				</tr>
				<c:forEach items="${page.result}" var="box">
					<tr bgcolor="#F4FaFb">
						<td height="20" align="center">${box.boxNo}</td>
						<td height="20" align="center">${box.orderEntity.orderNo}</td>
						<td height="20" align="center"> <fmt:formatDate value="${box.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<td height="20" align="center">${box.packer.realName}</td>
						<td height="20" align="center">${box.num}</td>
						<td height="20" align="center"><a href="${ctx}pack/toAddBoard.htm?boxNo=${box.boxNo}">添加主板</a></td>
					</tr>
				</c:forEach>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<%@include file="/WEB-INF/common/footer.jsp"%>
		</td>
	</tr>
</form>
</table>
</body>
</html>
